import { defineStore } from 'pinia'

import { store } from '@renderer/plugins/store'
import { homepageRouterList } from '@renderer/plugins/router'

export const usePermissionStore = defineStore('permission', {
  state: () => ({
    routers: []
  }),
  actions: {
    async initRoutes() {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      this.routers = [...homepageRouterList] as any
    }
  }
})
export function getPermissionStore() {
  return usePermissionStore(store)
}
